const http = uni.$u.http
function getConfig(config) {
    return {
        ...config,
        header: {
            Accept: 'application/json'
        }
    }
}
// post请求，获取菜单
export default {
    bannerList: (data, config = {}) => http.get('/banner/list'),
    categoryList: (data, config = {}) => http.get('/category/list', data),
    categoryProductList: (data, config = {}) => http.get('/category/productList', data),
    goodsList: (data, config = {}) => http.get('/goods/list', data),
    // 收藏
    collectList: (data, config = {}) => http.get('/collect/list', data),
    // 更新收藏
    updateCollect: (data, config = {}) => http.put('/collect/' + data.id, data),
    deleteCollect: (data, config = {}) => http.delete('/collect/' + data.id),
    createCollect: (data, config = {}) => http.post('/collect', data),
    goodsDetail: (data, config = {}) => http.get('/goods/' + data.id),
    register: (data, config = {}) => http.post('/member/register', data),
    login: (data, config = {}) => http.post('/member/login', data),
    memberInfo: (id, config = {}) => http.get('/member/' + id),
    updateMember: (data, config = {}) => http.put('/member/' + data.id, data),
    addressList: (data, config = {}) => http.get('/address/list', data),
    addressDetail: (data, config = {}) => http.get('/address/' + data.id),
    addAddress: (data, config = {}) => http.post('/address', data),
    updateAddress: (data, config = {}) => http.put('/address/' + data.id, data),
    deleteAddress: (data, config = {}) => http.delete('/address/' + data.id),
    createOrder: (data, config = {}) => http.post('/orderGoods', data),
    orderList: (data, config = {}) => http.get('/orderGoods/list', data),
    orderDetail: (data, config = {}) => http.get('/orderGoods/' + data.id),
    updateOrder: (data, config = {}) => http.put('/orderGoods/' + data.id, data),
    deleteOrder: (data, config = {}) => http.delete('/orderGoods/' + data.id, data),
    // 优惠券
    couponList: (data, config = {}) => http.get('/couponMember/list', data),
}